package com.menu.system.service.impl;

import java.util.List;
import com.menu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.menu.system.mapper.MenuPublicattributeDataMapper;
import com.menu.system.domain.MenuPublicattributeData;
import com.menu.system.service.IMenuPublicattributeDataService;

/**
 * 共有类型属性Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-08
 */
@Service
public class MenuPublicattributeDataServiceImpl implements IMenuPublicattributeDataService 
{
    @Autowired
    private MenuPublicattributeDataMapper menuPublicattributeDataMapper;

    /**
     * 查询共有类型属性
     * 
     * @param publicattributeCode 共有类型属性主键
     * @return 共有类型属性
     */
    @Override
    public MenuPublicattributeData selectMenuPublicattributeDataByPublicattributeCode(Long publicattributeCode)
    {
        return menuPublicattributeDataMapper.selectMenuPublicattributeDataByPublicattributeCode(publicattributeCode);
    }

    /**
     * 查询共有类型属性列表
     * 
     * @param menuPublicattributeData 共有类型属性
     * @return 共有类型属性
     */
    @Override
    public List<MenuPublicattributeData> selectMenuPublicattributeDataList(MenuPublicattributeData menuPublicattributeData)
    {
        return menuPublicattributeDataMapper.selectMenuPublicattributeDataList(menuPublicattributeData);
    }

    /**
     * 新增共有类型属性
     * 
     * @param menuPublicattributeData 共有类型属性
     * @return 结果
     */
    @Override
    public int insertMenuPublicattributeData(MenuPublicattributeData menuPublicattributeData)
    {
        menuPublicattributeData.setCreateTime(DateUtils.getNowDate());
        return menuPublicattributeDataMapper.insertMenuPublicattributeData(menuPublicattributeData);
    }

    /**
     * 修改共有类型属性
     * 
     * @param menuPublicattributeData 共有类型属性
     * @return 结果
     */
    @Override
    public int updateMenuPublicattributeData(MenuPublicattributeData menuPublicattributeData)
    {
        menuPublicattributeData.setUpdateTime(DateUtils.getNowDate());
        return menuPublicattributeDataMapper.updateMenuPublicattributeData(menuPublicattributeData);
    }

    /**
     * 批量删除共有类型属性
     * 
     * @param publicattributeCodes 需要删除的共有类型属性主键
     * @return 结果
     */
    @Override
    public int deleteMenuPublicattributeDataByPublicattributeCodes(Long[] publicattributeCodes)
    {
        return menuPublicattributeDataMapper.deleteMenuPublicattributeDataByPublicattributeCodes(publicattributeCodes);
    }

    /**
     * 删除共有类型属性信息
     * 
     * @param publicattributeCode 共有类型属性主键
     * @return 结果
     */
    @Override
    public int deleteMenuPublicattributeDataByPublicattributeCode(Long publicattributeCode)
    {
        return menuPublicattributeDataMapper.deleteMenuPublicattributeDataByPublicattributeCode(publicattributeCode);
    }
}
